package com.example.config;


import com.example.bean.BlankDisc;
import com.example.bean.CompactDisc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

@Configuration
@PropertySource(value = "classpath:app.properties", encoding = "UTF-8")
public class AppConfig {

    @Autowired
    private Environment environment;

    @Bean
    public CompactDisc disc(){
        return new BlankDisc(
                environment.getProperty("disc.title"),
                environment.getProperty("disc.artist"));
    }
}
